const WebSocket = require('ws');

let ws = new WebSocket('ws://localhost:8081/test');

// 打开WebSocket连接
ws.on('open', function () {
    console.log(`[CLIENT] open()`);

    ws.send('Hello!'); //发送一条消息:
});

// 响应收到的消息:
ws.on('find', function (message) {
    console.log(`[CLIENT] Received: ${message}`);
});
